package java2022spring;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

public class Button extends JButton {

    private static final int Button_Width=115;
    private static final int Button_Height=100;

    public Button(String name,ActionListener event){
        setText(name);
        setSize(Button_Width,Button_Height);
        addActionListener(event);
        setFocusable(false);//取消焦点
        setFont(new Font("Comic Sans Ms",Font.BOLD+Font.ITALIC,28));//设置字体
        setCursor(new Cursor(Cursor.HAND_CURSOR));//设置鼠标样式
    }
}
